"""
# !/usr/bin/python3
@Date    : 2018-04-09 14:23:20
@Author  : zhangcaocao (zhangcaocao66@gmail.com)
@Website : http://little-rocket.cn/
"""

import numpy as np
import matplotlib.pyplot as plt
import sympy
import platform
import serial


data_list = [(10, 20), (30, 50), (40, 20), (60, 80)]
x_list = []
y_list = []

def Help():
    print(platform.python_version())


class Map_postback:

    def Check_Data():
        return True

    def Draw():
        for k in range(len(data_list)):
            x_list.append(data_list[k][0])
            y_list.append(data_list[k][1])

        plt.figure(1)
        plt.plot(x_list, y_list, c='g')



class My_serial(object):
	"""docstring for My_serial"""
	def __init__(self, port, buand):
		super(My_serial, self).__init__()
		self.port = serial.Serial(port, buand)

	def Open_Port(self):
		if not self.port.isOpen():
			self.port.open()

	def Close_Port(self):
		self.port.close()

	def Send_date(self, data):
		number = self.port.write(data)
		return number

	def Read_data(self):
		data = self.port.read()
		data_list.append(data)
		return data_list



    

